<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.line{border-bottom:3px solid lightgray}
	.border-lavener{
		border: 1px solid #e6e6fa;
	}
	
	.musicContainer{
		max-width: none!important;
		width: 940px;
	}
	
	.titleSection{
		position: relative;
		min-height: 30px;
		border: 1px solid #e6e6fa;
		padding-bottom: 5px;
		padding-top: 5px;
		padding-left: 20px;
		padding-right: 20px;
		margin-top: 5px;
		margin-bottom: 5px;
		background-color: #f5f5f5;
	}
	
	.contentSection{
		height: 420px;	
	}

	.freeContainer:before, .freeContainer:after,
	.titleSection:before, .titleSection:after,
	.contentSection:before, .contentSection:after{
		content: " ";
		display: table;
	}
	:before, :after{
		box-sizing: border-box;
	}
	.freeContainer:after, .titleSection:after,
	.contentSection.after{
		clear: both;
	}
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#modifyForm").submit(function(){
			 if($(":input[name=title]").val()==""){
				alert("제목을 쓰세요.");
				$(":input[name=title]").focus();
				return false;
			}else if($("textarea[name=content]").val()==""){
				alert("내용을 작성하세요.");
				$("textarea[name=content]").focus();
				return false;
			}else{
				$("#modifyForm").submit();
			}
		});
		$("#cancel").click(function(){
			location.href="getQnAList.ju";
		});
	});
</script>

</head>
<body>
<!-- 내용 -->
<form id="modifyForm" action="${initParam.root }modifyQnA.ju" method="post">	
	<input type="hidden" name="no" value="${bvo.no}">
	
	<div class="form-group">
	  <label for="inputTitle" class="col-lg-2 control-label">제목</label>
	  <div class="col-lg-10">
	    <input type="text" class="form-control" id="inputTitle" placeholder="Title" name="title" value="${requestScope.bvo.title }" >
	    <br>
	  </div>
	</div>
	
	<div class="form-group">
      <label for="textArea" class="col-lg-2 control-label">내용</label>
      <div class="col-lg-10">
        <textarea class="form-control" rows="5" id="textArea" name="content" style="resize:none">${requestScope.bvo.content }</textarea>
        <br>
      </div>
    </div>
	
	<div class="form-group">
      <div class="col-lg-10 col-lg-offset-2" align="center">
        <button type="button" class="btn btn-default" id="cancel">취소</button>
        <button type="submit" class="btn btn-primary">수정하기</button>
        <br><br>
      </div>
    </div>

<%-- <table border="1" cellpadding="5">
<tr>
	<td>글번호	<input type="text" name="no" value="${requestScope.bvo.no}" readonly></td>
	<td colspan="2">글제목<input type="text" name="title" value="${requestScope.bvo.title }" size="50"></td>
</tr>
<tr>
	<td>작성자<input type="text" name="nickname" value="${requestScope.bvo.memberVO.nickname}" readonly></td>
	<td>작성일자<input type="text"  name="date" value="${requestScope.bvo.date }" readonly></td>
	<td>조회수<input type="text" name="hit" value="${requestScope.bvo.hit}" readonly></td>
</tr>
<tr>
	<td colspan="3">
	<textarea rows="15" cols="95" name="content">${requestScope.bvo.content }</textarea>
	</td>
</tr>		
<tr>
<td colspan="3" align="center">
<input type="submit" value="수정하기" >
</td>
</tr>		
</table>		 --%>
</form>
</body>
</html>